$(function () {

 init();

 function init() {

  discountData();
 }

 function discountData() {
  $.get("http://193.112.55.79:9090/api/getdiscountproduct",{productid: getUrl('productid')}, function (res) {
   var data = res.result;
   // console.log(data);
   
   var html = template('discountTpl',{arr:data})
   
   // console.log(html);
   $(".container").html(html)
  })
 }

 function  getUrl(name) {
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  var r = window.location.search.substr(1).match(reg);
  if (r != null) return decodeURI(r[2]);
  return null;
 }

})